package com.wd.db;
import java.sql.Connection;
import java.sql.SQLException;

import com.mchange.v2.c3p0.ComboPooledDataSource;


  
public class C3P0 {   
    
    private static ComboPooledDataSource dataSource = null;
    public C3P0() {   
    	dataSource = new ComboPooledDataSource();
    }   
  
    public static void init() 
    {
    	dataSource = new ComboPooledDataSource();
       try {   
    	   dataSource.setDriverClass("com.mysql.jdbc.Driver");
    	   dataSource.setJdbcUrl("jdbc:mysql://192.168.0.144:3306/Mutil_TexasPoker?useUnicode=true&amp;characterEncoding=GBK");
           dataSource.setUser("long");
           dataSource.setPassword("1234");
           dataSource.setMaxPoolSize(120);
           dataSource.setMinPoolSize(30);
           dataSource.setInitialPoolSize(30);
         
    	 
        } catch (Exception e) {   
            //   
        }   
    }   
  
  
    public static synchronized Connection getConnection() throws  SQLException {   
                       return dataSource.getConnection(); 
     }   
}    